package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.article.domain.Theme;
import cn.wolfcode.luowowo.article.util.ThemeTagDestlCondition;
import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

import java.time.Year;

@Setter
@Getter
public class ThemeTagDestQuery extends QueryObject {
    private Long themeId = -1L; //主题id用于区分是tagId
    private Long tagId = -1L; //标签id
    private Long mouthId = -1L; //时间id
    private Long yearId = -1L; //主题标签id
    private int dayId = -1; //天数

    public Long getMouthId() {
        if(tagId!=-1){
            if (themeId == Theme.THEME_DATA) {
                return this.tagId;
            }
        }
        return mouthId;
    }

    public Long getYearId() {
        if(tagId!=-1){
            if (themeId != Theme.THEME_DATA) {
                return this.tagId;
            }
        }
        return yearId;
    }

    /*   if(qo.getTagId()!=-1){
            if(qo.getThemeId()!=-1&&qo.getThemeId()==Theme.THEME_DATA){
                qo.setMouthId(qo.getTagId());
            }else{
                qo.setYearId(qo.getTagId());
            }
        }*/
    /*
     *
     * 真正的天数
     * */
    public ThemeTagDestlCondition getDays() {
        return ThemeTagDestlCondition.dayType.get(dayId);
    }
}
